package com.lhy.Dao;

import com.lhy.domain.ApplyMsg;
import com.lhy.domain.Chat;
import com.lhy.domain.ChatTea;
import com.lhy.domain.Friend;
import com.lhy.domain.NewMessage;
import com.lhy.domain.ShopCart;
import com.lhy.domain.Student;
import com.lhy.domain.StudentExample;
import com.lhy.domain.Tea;


import java.sql.Timestamp;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface StudentMapper {
   
    int insert(Student record);

    List<Student> selectByExample(StudentExample example);

    Student selectByPrimaryKey(Integer sequence);
    
    Student selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

	void saveChatTeaContent(@Param("sequence")Integer sequence,@Param("nickname") String nickname,@Param("content") String content);

	List<ChatTea> queryAllChatTea();

	List<Tea> selectTeas();

	Tea queryTeaByteaId(@Param("teaId")Integer teaId);

	Integer queryAllChatTeaCount();

	List<ChatTea> queryChatTeaBypage(@Param("startIndex")Integer startIndex,@Param("endIndex") Integer endIndex);

	void insertShoppingCart(@Param("sequence")Integer sequence,@Param("teaId") Integer teaId, @Param("teaname")String teaname, @Param("teaimg")String teaimg, @Param("url")String url,@Param("shopcartId") Integer shopcartId);


	Integer queryAllShopCartCountBysequence(@Param("sequence")Integer sequence);

	List<ShopCart> queryShopCartBySequencepage(@Param("sequence")Integer sequence,@Param("startIndex")Integer startIndex,@Param("endIndex") Integer endIndex);

	void removeShopCart(@Param("sequence")Integer sequence,@Param("shopcartId") Integer shopcartId);

	Tea queryTeaByteaname(@Param("teaname")String teaname);

	Student selectByUserName(@Param("username")String username);

	void deleteOverdueChatTea();

	Integer queryAllFriendCount(@Param("sequence")Integer sequence);

	List<Friend> queryAllFriend(@Param("sequence")Integer sequence);

	Integer queryAllUserCountDeleteFriends(@Param("sequence")Integer sequence,
			@Param("friendSequences")Integer[] friendSequences);

	List<Student> queryAllUserByPageDeleteFriends(@Param("sequence")Integer sequence,
			@Param("friendSequences")Integer[] friendSequences,@Param("startIndex") Integer startIndex,@Param("endIndex") Integer endIndex);

	Integer queryAllUserCount(@Param("sequence")Integer sequence);

	List<Student> queryAllUserByPage(@Param("sequence")Integer sequence,@Param("startIndex") Integer startIndex,
			@Param("endIndex")Integer endIndex);

	Student queryStudentByUsername(@Param("username")String username);

	void findFriendApply(@Param("sequence") Integer sequence,@Param("usersequence") Integer userSequence,
			@Param("userid") Integer userid,@Param("nickname") String nickname,@Param("email") String email,@Param("phonenumber") String phonenumber,
			@Param("remark") String remark,@Param("message") String message,@Param("create_dt") Timestamp create_dt,@Param("sex") String sex, @Param("state")Integer state,@Param("img") String img);

	Integer queryCountByUsername(@Param("username")String username);

	Integer selectCountByApplyMsg(@Param("usersequence") Integer usersequence);

	List<ApplyMsg> selectApplyMsgByUsersequenceAndPage(@Param("sequence")Integer sequence,@Param("startIndex") Integer startIndex,
			@Param("endIndex")Integer endIndex);

	ApplyMsg selectApplyMsgByUsersequenceAndMsgsequence(@Param("usersequence") Integer usersequence,
			@Param("msgsequence") Integer msgsequence);

	void insertFriend(@Param("usersequence")Integer usersequence, @Param("sequence") Integer sequence, @Param("userid") Integer userid, @Param("nickname") String nickname,
			@Param("remark") String remark, @Param("sex") String sex, @Param("email") String email, @Param("phonenumber") String phonenumber,@Param("img") String img);

	void createChatTableBySequence(@Param("sequence") Integer sequence, @Param("usersequence") Integer usersequence);

	void deleteFriendApplyBySequence(@Param("usersequence") Integer usersequence,@Param("msgsequence") Integer msgsequence);

	List<Friend> queryAllFriendByPage(@Param("sequence")Integer sequence,@Param("startIndex") Integer startIndex,
			@Param("endIndex")Integer endIndex);

	void deleteFriend(@Param("usersequence") Integer usersequence,@Param("sequence")Integer sequence);

	void deleteChatTable(@Param("count1")Integer count1,@Param("count2") Integer count2);

	List<Chat> queryMessageBySequence(@Param("sequence") Integer sequence, @Param("usersequence") Integer usersequence);

	void insertChatMessage(@Param("count1") Integer count1, @Param("count2") Integer count2, @Param("usersequence") Integer usersequence, @Param("sequence") Integer sequence,
			@Param("nickname") String nickname, @Param("remark") String remark, @Param("create_dt") Timestamp create_dt, @Param("message") String message);

	NewMessage queryNewMessageById(@Param("newmessage_id")Integer newmessage_id);

	void insertNewMessageByClob(@Param("author")String author,@Param("title") String title,@Param("content") String content, @Param("create_dt") Timestamp create_dt,@Param("sequence") Integer sequence,@Param("messageType") Integer messageType);

	Integer queryAllNewMessageCount();

	List<NewMessage> queryAllNewMessageByPage(@Param("startIndex")Integer startIndex,
			@Param("endIndex") Integer endIndex);

	List<NewMessage> queryNewMessageList();

	List<NewMessage> queryNewMessageListByPd(@Param("author")String author,@Param("title") String title,
			@Param("startTime")String startTime, @Param("endTime")String endTime);

	void deleteNewMessageByPd(@Param("newmessage_id")Integer newmessage_id);

	void updateNewMessage(@Param("author")String author,@Param("title") String title,@Param("content") String content,
			@Param("create_dt")Timestamp create_dt,@Param("newmessage_id") Integer newmessage_id);




}